/**
 * 
 */
package chatServer;

import java.io.Serializable;
import java.util.ArrayList;

import messenger.CommCommand;

/**
 * @author (Group 42) William Orem, Joseph Hamilton, Kevin Benik
 * 
 */
public class ChatPacket implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6041196867278803834L;
	private CommCommand command = null;
	private ArrayList<Object> msg = null;

	/**
	 * @param command
	 */
	public ChatPacket(CommCommand command) {
		this.command = command;
		this.msg = new ArrayList<Object>();
	}

	/**
	 * @param command
	 * @param msg
	 */
	public ChatPacket(CommCommand command, ArrayList<Object> msg) {
		this.command = command;
		this.msg = msg;
	}

	/**
	 * @return the command
	 */
	public CommCommand getCommand() {
		return command;
	}

	/**
	 * @return the msg
	 */
	public Object getMsg(int index) {
		return msg.get(index);
	}

	/**
	 * @return the msg
	 */
	public Object getMsgs() {
		return msg;
	}

	/**
	 * @param msg
	 *            the msg to set
	 */
	public void setMsg(int pos, Object val) {
		this.msg.add(pos, val);
	}

}
